GBML manual / Events

draw_end

Runs every frame, in world space, after Draw.

Syntax

draw_end: fires every frame, after Draw

Description

Runs every frame, in world space, after Draw - the last world-space drawing an instance gets before Draw GUI runs for the whole screen. Running last here only guarantees when your code runs, not what ends up on top - see bg_priority and depth for what actually decides that. The example below is the reliable way to draw something that must sit in front of everything else this instance draws (a flash, an outline): give it an explicit depth in front of the rest, rather than leaning on Draw End simply running last.

Example

draw_sprite_scaled(sprite, x, y, frame, angle, xscale, yscale, flip_x, flip_y, depth - 1);

Redraws this instance's own sprite one depth band closer to the camera than everything else it draws. draw_sprite_scaled takes its own depth argument, so depth - 1 is a real, guaranteed order rather than a tie settled by creation order - a cheap outline/flash trick that needs no second sprite asset.

See also: draw_begindrawdraw_guidraw_sprite_scaledbg_prioritydepthEvents